package com.qijian.common.timer;

import io.netty.util.Timeout;

import java.util.Date;
import java.util.concurrent.TimeUnit;
import java.util.function.Consumer;

public class TaskDefinition {

    public Long id;

    public long delay;

    public String type;

    public long lead;

    public Date deadline;

    public TimeUnit delayUnit;

    public Consumer<Long> task;
    public Consumer<String> taskWithType;

    public Timeout timeout;

    @Override
    public String toString() {
        return "TaskDefinition{" +
                "id=" + id +
                ", delay=" + delay +
                ", type=" + type +
                ", lead=" + lead +
                ", deadline=" + deadline +
                ", delayUnit=" + delayUnit +
                ", task=" + task +
                ", taskWithType=" + taskWithType +
                ", timeout=" + timeout +
                '}';
    }
}
